
import wx

class ColorManager: 
	def __init__(self):
		self.graph_colors = []
		self.graph_colors.append(wx.Colour(0,0,0))
		self.graph_colors.append(wx.Colour(255,255,255))
		self.graph_colors.append(wx.Colour(255,0,0))
		self.graph_colors.append(wx.Colour(0,255,0))
		self.graph_colors.append(wx.Colour(0,0,255))
		self.graph_colors.append(wx.Colour(255,0,255))
		self.graph_colors.append(wx.Colour(255,255,0))
		self.graph_colors.append(wx.Colour(0,255,255))
		self.graph_colors.append(wx.Colour(49,133,156))
		self.graph_colors.append(wx.Colour(96,74,123))

		self.graph_colors.append(wx.Colour(78,78,78))
		self.graph_colors.append(wx.Colour(241,124,176))
		self.graph_colors.append(wx.Colour(250,164,58))
		self.graph_colors.append(wx.Colour(96,189,104))
		self.graph_colors.append(wx.Colour(93,165,218))
		self.graph_colors.append(wx.Colour(178,145,47))
		self.graph_colors.append(wx.Colour(222,207,63))
		self.graph_colors.append(wx.Colour(178,118,178))
		self.graph_colors.append(wx.Colour(241,88,84))
		self.isPrintMode = True 

		# gray - 4D4D4D - 78,78,78
		# pink - F17CB0 - 241,124,176
		# orange - FAA43A - 250,164,58
		# green - 60BD68 - 96,189,104
		# blue - 5DA5DA - 93,165,218 
		# Brown - B2912F - 178,145,47
		# yellow - DECF3F - 222,207,63 
		# purple - B276B2 - 178,118,178
		# red - F15854 - 241,88,84 

	def destory(self):
		for color in self.graph_colors :
			del color 
		del self.graph_colors

	def getColor(self, idx):
		return self.graph_colors[idx]

	def getColorObj(self, type, opt):
		tmp = self.graph_color_value[type]
		r = int(tmp[0] * opt)
		g = int(tmp[1] * opt)
		b = int(tmp[2] * opt)
		return wx.Colour(r,g,b, 255) 

	def setPrintMode(self, flag=True):
		self.isPrintMode = flag

	def switchMode(self):
		if self.isPrintMode == False : 
			self.isPrintMode = True 
		else :
			self.isPrintMode = False 

	def getBackgroundColor(self): 
		if self.isPrintMode == True : 
			return self.graph_colors[1]
		else :
			return self.graph_colors[0]

	def getForegroundColor(self): 
		if self.isPrintMode == True : 
			return self.graph_colors[0]
		else :
			return self.graph_colors[1]

